<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>管理员登录</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="/static/myadmin/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="/static/myadmin/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="/static/myadmin/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="/static/myadmin/assets/css/amazeui.datatables.min.css" />
    <link rel="stylesheet" href="/static/myadmin/assets/css/app.css">
    <script src="/static/myadmin/assets/js/jquery.min.js"></script>
    <script src="/static/myadmin/assets/js/jq-slideVerify.js"></script>

</head>

<body data-type="login">
    <script src="/static/myadmin/assets/js/theme.js"></script>
    <div class="am-g tpl-g">
        <!-- 风格切换 -->
        <div class="tpl-skiner">
            <div class="tpl-skiner-toggle am-icon-cog">
            </div>
            <div class="tpl-skiner-content">
                <div class="tpl-skiner-content-title">
                    选择主题
                </div>
                <div class="tpl-skiner-content-bar">
                    <span class="skiner-color skiner-white" data-color="theme-white"></span>
                    <span class="skiner-color skiner-black" data-color="theme-black"></span>
                </div>
            </div>
        </div>
        <div class="tpl-login">
            <div class="tpl-login-content">
                <div class="tpl-login-logo">

                </div>



                <form class="am-form tpl-form-line-form" action="{% url 'user_log_check'%}" method="post">
                    <div class="am-form-group">
                        {% csrf_token %}
                        <input type="text" class="tpl-form-input" name="username" placeholder="请输入账号">

                    </div>

                    <div class="am-form-group">
                        <input type="password" class="tpl-form-input" name="password" placeholder="请输入密码">

                    </div>
                     <div class="am-form-group">
                      <input type="text" name="vcode" class="tpl-form-input"  placeholder="请输入验证码">
                      <img src="{% url 'verifycode'%}" style="display:none" id="img">
                    </div>
                    <div class="am-form-group tpl-login-remember-me">
                        <input id="remember-me" type="checkbox">
                        <label for="remember-me">

                        记住密码
                         </label>

                    </div>
                    <div class="verify-wrap" id="verify-wrap"></div>
                    <div class="am-form-group">

                        <button type="button" class="am-btn am-btn-primary  am-btn-block tpl-btn-bg-color-success  tpl-login-btn">提交</button>

                    </div>
                </form>
            </div>
        </div>
    </div>

<!--滑动验证-->

<script type="text/javascript">
    $(function(){
        console.log(parseFloat('1px'))

        var SlideVerifyPlug = window.slideVerifyPlug;
        var slideVerify = new SlideVerifyPlug('#verify-wrap',{
            wrapWidth:'300',//设置 容器的宽度 ，默认为 350 ，也可不用设，你自己css 定义好也可以，插件里面会取一次这个 容器的宽度
            initText:'请按住滑块获取验证码，123',  //设置  初始的 显示文字
            sucessText:'验证通过',//设置 验证通过 显示的文字
            getSucessState:function(res){
                //当验证完成的时候 会 返回 res 值 true，只留了这个应该够用了
                console.log(res);
                //滑过成功后变成submit
                $("button").removeAttr("type");
                $('img').css({'display':'block'})
            }
        });
        $("#resetBtn").on('click',function(){
            slideVerify.resetVerify();//可以重置 插件 回到初始状态
        })
        $("#getState").on('click',function(){
            alert(slideVerify.slideFinishState);   //这个可以拿到 当前验证状态  是否完成
        })
    })
</script>
    <script src="/static/myadmin/assets/js/amazeui.min.js"></script>
    <script src="/static/myadmin/assets/js/app.js"></script>

</body>

</html>